﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using WF_QLThuVien.DataLayer.PhieuMuon;
using WF_QLThuVien.Entities.PhieuMuon;
using System.Collections;

namespace WF_QLThuVien.BusinessLayer.PhieuMuon
{
    public class CCTPhieuMuonBLL
    {
        CCTPhieuMuonDAL dalCCTPhieuMuon = new CCTPhieuMuonDAL();

        public bool themCTPhieuMuon(CCTPhieuMuon ctpm)
        {
            try
            {
                if (dalCCTPhieuMuon.themCTPhieuMuon(ctpm))
                {
                    return true;
                }
                else
                {
                    return false;
                }
            }
            catch (System.Exception ex)
            {
                throw ex;
            }
        }

        public CCTPhieuMuon timCTPMByPhieuMuonID(string phieuMuonID)
        {
            try
            {
                return dalCCTPhieuMuon.timCTPMByPhieuMuonID(phieuMuonID);
            }
            catch (System.Exception ex)
            {
                throw ex;
            }
        }

        public List<CCTPhieuMuon> timListCTPMByPhieuMuonID(string phieuMuonID)
        {
            try
            {
                return dalCCTPhieuMuon.timListCTPMByPhieuMuonID(phieuMuonID);
            }
            catch (System.Exception ex)
            {
                throw ex;
            }
        }

        public bool updateSoLanGiaHan(string maSach)
        {
            try
            {
                return dalCCTPhieuMuon.updateSoLanGiaHan(maSach);
            }
            catch (System.Exception ex)
            {
                throw ex;
            }
        }

        public int SoLanGiaHan(string maSach)
        {
            try
            {
                return dalCCTPhieuMuon.TimSoLanGiaHanByMaSach(maSach);
            }
            catch (System.Exception ex)
            {
                throw ex;
            }
        }

        public int TimSoCTPMByMaDocGia(string maDocGia)
        {
            try
            {
                return dalCCTPhieuMuon.TimSoCTPMByMaDocGia(maDocGia);
            }
            catch (System.Exception ex)
            {
                throw ex;
            }
        }
    }
}
